/*
 * 教育程度
 */
var educationArray = new Array(
		new Education("初中","1"),
		new Education("高中","2"),
		new Education("中专/技校","3"),
		new Education("大专","4"),
		new Education("大学","5"),
		new Education("硕士","6"),
		new Education("博士","7"),
		new Education("海外","8")
);

function Education(ename,eid) {
	this.ename = ename;
	this.eid = eid;
}

/**
 * 创建教育程度的下拉列表框
**/
function createEduSelect(select) {
	var eduLength = educationArray.length;
	for(var i = 0; i < eduLength; i++) {
		var education = educationArray[i];
		var eduOption = document.createElement('OPTION');
		eduOption.text = education["ename"];
		eduOption.value = education["eid"];
		select.options.add(eduOption);
	}
}

/*
 * 民族
 */
var nationArray = new Array(
		new Nation("汉族","1"),
		new Nation("蒙古族","2"),
		new Nation("回族","3"),
		new Nation("藏族","4"),
		new Nation("维吾尔族","5"),
		new Nation("苗族","6"),
		new Nation("彝族","7"),
		new Nation("壮族","8"),
		new Nation("布依族","9"),
		new Nation("朝鲜族","10"),
		new Nation("满族","11"),
		new Nation("侗族","12"),
		new Nation("瑶族","13"),
		new Nation("白族","14"),
		new Nation("土家族","15"),
		new Nation("哈尼族","16"),
		new Nation("哈萨克族","17"),
		new Nation("傣族","18"),
		new Nation("黎族","19"),
		new Nation("傈僳族","20"),
		new Nation("佤族","21"),
		new Nation("畲族","22"),
		new Nation("高山族","23"),
		new Nation("拉祜族","24"),
		new Nation("水族","25"),
		new Nation("东乡族","26"),
		new Nation("纳西族","27"),
		new Nation("景颇族","28"),
		new Nation("柯尔克孜族","29"),
		new Nation("土族","30"),
		new Nation("达斡尔族","31"),
		new Nation("仫佬族","32"),
		new Nation("羌族","33"),
		new Nation("布朗族","34"),
		new Nation("撒拉族","35"),
		new Nation("毛难族","36"),
		new Nation("仡佬族","37"),
		new Nation("锡伯族","38"),
		new Nation("阿昌族","39"),
		new Nation("普米族","40"),
		new Nation("塔吉克族","41"),
		new Nation("怒族","42"),
		new Nation("乌孜别克族","43"),
		new Nation("俄罗斯族","44"),
		new Nation("鄂温克族","45"),
		new Nation("崩龙族","46"),
		new Nation("保安族","47"),
		new Nation("裕固族","48"),
		new Nation("京族","49"),
		new Nation("塔塔尔族","50"),
		new Nation("独龙族","51"),
		new Nation("鄂伦春族","52"),
		new Nation("赫哲族","53"),
		new Nation("门巴族","54"),
		new Nation("珞巴族","55"),
		new Nation("基诺族","56"),
		new Nation("其他","57")
);

function Nation(nname,nid) {
	this.nname = nname;
	this.nid = nid;
}

/**
 * 创建民族的下拉列表框
**/
function createNationSelect(select) {
	var nationLength = nationArray.length;
	for(var i = 0; i < nationLength; i++) {
		var nation = nationArray[i];
		var nationOption = document.createElement('OPTION');
		nationOption.text = nation["nname"];
		nationOption.value = nation["nid"];
		select.options.add(nationOption);
	}
}


/*
 * 职称
 */
var gradeArray = new Array(
		new Grade("教师职称","1","0"),
		new Grade("行政级别","2","0"),
		new Grade("正高级教师","3","1"),
		new Grade("高级教师","4","1"),
		new Grade("一级教师","5","1"),
		new Grade("二级教师","6","1"),
		new Grade("三级教师","7","1"),
		new Grade("其他","8","1"),
		new Grade("正国级","9","2"),
		new Grade("副国级","10","2"),
		new Grade("正部级","11","2"),
		new Grade("副部级","12","2"),
		new Grade("正县级","13","2"),
		new Grade("副县级","14","2")
);

function Grade(gname,gid,pid) {
	this.gname = gname;
	this.gid = gid;
	this.pid = pid;
}

/**
 * 创建职称的下拉列表框
**/
function createGradeSelect(select,flag) {
	var gradeLength = gradeArray.length;
	for(var i = 0; i < gradeLength; i++) {
		var grade = gradeArray[i];
		if(flag == grade["pid"]){
			var gradeOption = document.createElement('OPTION');
			gradeOption.text = grade["gname"];
			gradeOption.value = grade["gid"];
			select.options.add(gradeOption);
		}
	}
}

/**
 * 企业规模
 */
var bsArray = new Array(
		new BusinessScale("微型(20人以下)", 1),
		new BusinessScale("小型(20-49人)", 2),
		new BusinessScale("中型(50-199人)", 3),
		new BusinessScale("中大型(200-499人)", 4),
		new BusinessScale("大型(500-999人)", 5),
		new BusinessScale("超大型(1000人以上)", 6)
);

function BusinessScale(bsName,bsId) {
	this.bsName = bsName;
	this.bsId = bsId;
}

/**
 * 创建企业规模下拉框
 * @param select
 */
function createBsSelect(select) {
	var bsLength = bsArray.length;
	for(var i = 0; i < bsLength; i++) {
		var scale = bsArray[i];
		var bsOption = document.createElement('OPTION');
		bsOption.text = scale["bsName"];
		bsOption.value = scale["bsId"];
		select.options.add(bsOption);
	}
}

/**
 * 行业类别/机构类别
 */
var categoryArray = new Array(
		new Category("行业类别","1","0"),
		new Category("机构类别","2","0"),
		new Category("IT/互联网/电子产品","3","1"),
		new Category("商务服务","5","1"),
		new Category("餐饮美食","6","1"),
		new Category("食品饮料","7","1"),
		new Category("美容美发/彩妆卫浴","8","1"),
		new Category("休闲娱乐","9","1"),
		new Category("绿色环保","10","2"),
		new Category("支教助学","11","2"),
		new Category("扶贫支农","12","2"),
		new Category("动物保护","13","2"),
		new Category("扶孤助残","14","2"),
		new Category("医疗卫生","15","2"),
		new Category("灾难救助","16","2"),
		new Category("社区义工","17","2"),
		new Category("法律维权","18","2"),
		new Category("综合","19","2"),
		new Category("服饰/箱包/运动户外","20","1"),
		new Category("生活服务","21","1"),
		new Category("文化体育","22","1"),
		new Category("旅游酒店","23","1"),
		new Category("教育","24","1"),
		new Category("金融服务","25","1"),
		new Category("医疗健康","26","1"),
		new Category("汽车交通","27","1"),
		new Category("商城购物","28","1"),
		new Category("房产家居/装饰","29","1"),
		new Category("通讯服务","30","1"),
		new Category("工农贸易","31","1"),
		new Category("其他","32","1")
);

function Category(title,categoryId,pid) {
	this.title = title;
	this.categoryId = categoryId;
	this.pid = pid;
}

/**
 * 创建类别下拉框
 * @param select	下拉框
 * @param pid		父级类别		
 */
function createCategorySelect(select,pid) {
	var categoryLength = categoryArray.length;
	for (var i = 0; i < categoryLength; i++) {
		var category = categoryArray[i];
		if(pid == category["pid"]) {
			var categoryOption = document.createElement("OPTION");
			categoryOption.text = category["title"];
			categoryOption.value = category["categoryId"];
			select.options.add(categoryOption);
		}
	}
}

/**
 * 经济类型
 */
var etArray = new Array(
		new EconomicType("国有经济", 1),
		new EconomicType("集体经济", 2),
		new EconomicType("私营经济", 3),
		new EconomicType("个体经济", 4),
		new EconomicType("联营经济", 5),
		new EconomicType("股份制", 6),
		new EconomicType("外商投资", 7),
		new EconomicType("港澳台投资", 8),
		new EconomicType("其他经济类", 9)
);

function EconomicType(etname,etid) {
	this.etname = etname;
	this.etid = etid;
}

/**
 * 创建经济类型下拉框
 * @param select
 */
function createEtSelect(select) {
	var etLength = etArray.length;
	for(var i = 0; i < etLength; i++) {
		var economicType = etArray[i];
		var etOption = document.createElement('OPTION');
		etOption.text = economicType["etname"];
		etOption.value = economicType["etid"];
		select.options.add(etOption);
	}
}

/**
 * 教练计划角色
 */
var cpRleArray = new Array(
		//改 >>>  后面的数字为 sort
	new cpRole("社会志愿者", 11),	
	new cpRole("学生志愿者", 12),	
	new cpRole("梦想领队", 13),	
	new cpRole("梦想教练", 14)	
);

function cpRole(cpRleName,cpRleId) {
	this.cpRleName = cpRleName;
	this.cpRleId = cpRleId;
}

/**
 * 创建教练计划角色下拉框
 * @param select
 */
function createCpRoleSelect(select) {
	var cpRleLength = cpRleArray.length;
	for (var i = 0; i < cpRleLength; i++) {
		var cpRole = cpRleArray[i];
		var cpRleOption = document.createElement('OPTION');
		cpRleOption.text = cpRole["cpRleName"];
		cpRleOption.value = cpRole["cpRleId"];
		select.options.add(cpRleOption);
	}
}

/**
 * 教练计划年份
 */
var cpYearArray = new Array(
//	new cpYear("2019", 2019);
//	new cpYear("2020", 2020)
//	new cpYear("2021", 2021)
	new cpYear("2022", 2022)
);

function cpYear(cpYearText,cpYearValue) {
	this.cpYearText = cpYearText;
	this.cpYearValue = cpYearValue;
}

/**
 * 创建教练计划年份下拉框
 * @param select
 */
function createCpYearSelect(select) {
	var cpYearLength = cpYearArray.length;
	for (var i = 0; i < cpYearLength; i++) {
		var cpYear = cpYearArray[i];
		var cpYearOption = document.createElement('OPTION');
		cpYearOption.text = cpYear["cpYearText"];
		cpYearOption.value = cpYear["cpYearValue"];
		select.options.add(cpYearOption);
	}
}